//
//  GTSubCategoryCell.m
//  GiftTalk
//
//  Created by Wan on 16/4/8.
//  Copyright © 2016年 Wan. All rights reserved.
//

#import "GTSubCategoryCell.h"
#import "GTSubCategory.h"
#import "UIImageView+Extension.h"

@interface GTSubCategoryCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@end

@implementation GTSubCategoryCell

- (void)awakeFromNib {
    // Initialization code
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
    GTSubCategoryCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:subCategoryIdentifier forIndexPath:indexPath];
    return cell;
}

- (void)setSubCategory:(GTSubCategory *)subCategory {
    _subCategory = subCategory;
    [self.iconView setImage:subCategory.icon_url placeHolder:@"placeholderimage_small"];
    self.nameLabel.text = subCategory.name;
}

@end
